//2009/07/31 12:03:08
#include <iostream>
#include <string>
#include <vector>
#include <sstream>
#include <algorithm>

using namespace std;

class StreetParking
{
public:
	int freeParks(string street)
	{
		int count = 0;
		string str("*" + street + "**"); // This one is very smart.
		for(int i=1; i<str.size()-2; i++)
		{
			char current = str[i];
			char previous = str[i-1];
			char next = str[i+1];
			char next2 = str[i+2];
			if(current == '-' && previous != 'S' &&  next != 'B' && next != 'S' && next != 'B')
				count ++;
		}
		return count;
	}
};
